Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1041367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:20:31+00:00 2026-05-16T15:20:31+00:00

I wrote a small script for work and when developing it everything was fine

  • 0

I wrote a small script for work and when developing it everything was fine but
when I turned it over for production use people complained about the time it
took to display the first form. Looking into it, all the time seemed to be
spent in importing various modules used by the script. I made a new script
of just the import statements and a print Hello World and then ran it both as
a python script and an executable with the results below. What’s going on and
is there any way to speed this up?

Python file:

$ for i in {1..10}
> do
>   time ./ipy.exe time.py
> done
real    0m1.712s
real    0m1.701s
real    0m1.689s
real    0m1.691s
real    0m1.709s
real    0m1.663s
real    0m1.697s
real    0m1.700s
real    0m1.699s
real    0m1.741s

exe built with ipy pyc.py /main:time.py /target:exe

$ for i in {1..10}
> do
>   time ./time.exe | grep -v user | grep -v sys
> done
real    0m22.119s
real    0m22.116s
real    0m22.133s
real    0m21.816s
real    0m21.985s
real    0m21.785s
real    0m22.010s
real    0m21.686s
real    0m21.877s
real    0m21.944s

contents of time.py:

import clr
from clr import AddReference
AddReference("System.Windows.Forms")
AddReference("System.Drawing")
AddReference("p4api")
import cgi
from System.Diagnostics import Process
from P4API import *
import System
from System import *
from System.Windows.Forms import *
from System.ComponentModel import *
from System.Drawing import *
from System.Threading import *
import re
import urllib
import os
import tokenize
from cStringIO import StringIO
from optparse import OptionParser
import os
import urllib
import ntpath
import stat
import genericpath
import warnings
import linecache
import types
import UserDict
import _abcoll
import abc
import textwrap
import string
import urlparse
import collections
import keyword
import nturl2path
import mimetools
import tempfile
import random
import __future__
import rfc822
import tokenize
import token
import codecs
import ConfigParser
import uuid
import sys

print "Hello World"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:20:32+00:00Added an answer on May 16, 2026 at 3:20 pm

    A combination of adding /platform:x86 to the pcy.py call and running ngen on the resulting dll and exe reduced the execution time of the exe to 1/2 that of the invoking it as a script. I’d call that successful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote an small script to use split() as this, use strict; use warnings;
So I've wrote a small script to download pictures from a website. It goes
I just started playing with Clojure, and I wrote a small script to help
I wrote a small express.js based web app. I serve a manifest.webapp but express.js
I wrote some small apps using .NET 3.5 but now I am stuck with
I'm currently working on a small script that needs to use gtk.StatusIcon() . For
I wrote a small-ish Python script that handles nightly conversions and archiving of audio
I wrote a little in page script to relocate a small box containing the
I wrote a small script to help re-organize my .mp3 collection. When I run
Backup Script Please check the link above, I wrote this small script in python.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.