Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Ben Finney
Johannes Bauer  writes:

> You're entirely right that this kind of personal feud and immature
> mockery is inappropriate for a mailing list and you're also right that
> it does create a toxic atmosphere. Since Python is the lanauge I'm
> most passionate about a detrimental effect on the Python community is
> something that is surely the exact opposite of what I want.
[…]

> I'll follow your advice and thank you for your honest words.

Thank you for publicly acknowledging this, and for taking responsibility
for positive change. This is essential to keeping our community healthy.

-- 
 \“Technology is neither good nor bad; nor is it neutral.” |
  `\   —Melvin Kranzberg's First Law of Technology |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Johannes Bauer
On 23.08.2015 18:47, Michael Torrie wrote:

> Since this is an ajax thing, I can entirely
> understand that Firefox introduces random delays.  Practically all
> ajax-heavy sites I've ever used has had random slowdowns in Firefox.

This would imply that random six-second delays have somehow passed the
Firefox QA effortlessly. It's something that is entirely possible, but
also something that I would consider magnitudes less likely than other
explanations. Six seconds is *huge* for regular web applications.

> Name resolution could be an issue, but the script he wrote to simulate
> the browser requests does not show the slowdown at all.  Firefox could
> be doing name resolution differently than the rest of the system and
> Chrome of course, which wouldn't surprise me as Firefox seems to more
> and more stupid stuff.

Proxy settings are another thing that could influence behavior. Maybe
the proxy of his Chrome is differently configured than Firefox and this
is causing issues. SOCKS proxies can emulate DNS as well. So there is a
plethora of possible causes; no need to shift blame before evidence is
presented, no need to jump to conclusions.

> But your bashing on him is inappropriate and
> unhelpful.
[...]
> What is annoying to me is how you have done nothing but jump all over
> him this whole thread, and several other times.  
[...]
> In fact I can find very few of your posts to this list where you
> aren't bashing Cecil in recent months.  This does not reflect well on
> the list community and drives away people who would otherwise want to
> learn Python.

I think you're right about this. I've had some run-in with Cecil some
months ago - don't even remember what it was about. The thing I did
remember was that I was particularly annoyed by the whole discussion
back then. This probably led to me being a lot more agressive in my
choice of tone than I should have been.

You're entirely right that this kind of personal feud and immature
mockery is inappropriate for a mailing list and you're also right that
it does create a toxic atmosphere. Since Python is the lanauge I'm most
passionate about a detrimental effect on the Python community is
something that is surely the exact opposite of what I want.

> If Cecil's posts annoy you, please ignore them (I wouldn't even respond
> to this post of yours, but I feel like something has to be said).

I'll follow your advice and thank you for your honest words.

Cheers,
Johannes

-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
 - Karl Kaos über Rüdiger Thomas in dsa 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Michael Torrie
On 08/23/2015 08:05 AM, Johannes Bauer wrote:
> By git bisect he can find out where
> he introduced the bug.

Like Cecil said, this is of little help.  There was no code changed from
when he didn't notice the behavior until he did.

>> Note that this says nothing about the location of the bug, in can still
>> be either in the OPs code or in the framework.
> 
> Yup. Note that he has now shifted from blaming bottle to blaming
> Firefox. Same thing with that claim. If somehow website delivery was
> delayed 6 seconds reproducibly, people would have noticed.

Well it does look like the problem is indeed inside firefox.  Chrome
does exhibit the problem.  Just fetching the urls in a script does not
have the problem either.  Since this is an ajax thing, I can entirely
understand that Firefox introduces random delays.  Practically all
ajax-heavy sites I've ever used has had random slowdowns in Firefox.

> I suspect that either the OPs program is at fault or the OP's setup
> (name resolution or some other weird stuff going on). 

Name resolution could be an issue, but the script he wrote to simulate
the browser requests does not show the slowdown at all.  Firefox could
be doing name resolution differently than the rest of the system and
Chrome of course, which wouldn't surprise me as Firefox seems to more
and more stupid stuff.

> But instead of
> tackling this problem systematically, like a Software Engineer would
> (Wireshark, debugger, profiler) he just blames other people's software.
> This, in my humble opinion, is annoying

He is tackling the problem systematically, though perhaps not in the
same way you would. Sure there are ways he can improve his process, and
he is doing that slowly.  But your bashing on him is inappropriate and
unhelpful.  And sometimes things that are obvious to you and others
(such as strings being iterable in his sql binding problem) are not
obvious to new users of python, even ones with a lot of experience in
other languages.

What is annoying to me is how you have done nothing but jump all over
him this whole thread, and several other times.  You seem to have made
it your mission to bash him continually on this list, mocking him and
saying if he were a wise Senior Software Engineer he would know such and
such.  In fact I can find very few of your posts to this list where you
aren't bashing Cecil in recent months.  This does not reflect well on
the list community and drives away people who would otherwise want to
learn Python.

If Cecil's posts annoy you, please ignore them (I wouldn't even respond
to this post of yours, but I feel like something has to be said).

I for one am happy to help out, and I'm very glad to see a person come
and learn python and be enthusiastic about it.  Unlike many people
learning Python, Cecil has made a strong attempt to learn the idiomatic
ways of programming in Python, and seems to be really enjoying it.  He
hasn't been turned off by the sometimes toxic atmosphere of the list.
He hasn't run off saying Python sux because of whitespace.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Cecil Westerhof
On Sunday 23 Aug 2015 17:44 CEST, MRAB wrote:

>> I never blamed bottle, I was asking if it could be a problem with
>> bottle.
>>
> The subject says otherwise. :-)

Yeah, my communication skills can take some improvement. I meant: I
have this problem. I think it could have to do something with bottle.
Can anybody shed some light on it?

I hope to be more precise next time.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-23 Thread MRAB

On 2015-08-23 16:20, Cecil Westerhof wrote:

On Sunday 23 Aug 2015 16:05 CEST, Johannes Bauer wrote:


On 22.08.2015 16:15, Christian Gollwitzer wrote:


Probably yes. You should take a look at the OP again and compare
the time stamps. It says that in between two consecutive calls of
the same program, the request was served once in a second, and once
with serious delays. Despite that the server is localhost. In
between both trials there are 20 seconds. I do not see, how git
bisect would help here.


I do completely understand that in two consecutive runs one time the
problem occurs and the other time it doesn't.

It's highly unlikely that such a bug would ever have passed the
bottle QA and if it did it would affect thousands of users (who
would report this issue, since it's very severe). It is much more
likely the bug is somewhere within the OP's program. By git bisect
he can find out where he introduced the bug.


You have to explain something to me: how can I introduce a bug without
changing anything? Maybe by having wrong thoughts?



Note that this says nothing about the location of the bug, in can
still be either in the OPs code or in the framework.


Yup. Note that he has now shifted from blaming bottle to blaming
Firefox. Same thing with that claim. If somehow website delivery was
delayed 6 seconds reproducibly, people would have noticed.


I never blamed bottle, I was asking if it could be a problem with
bottle.


The subject says otherwise. :-)

[snip]

--
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Cecil Westerhof
On Sunday 23 Aug 2015 16:05 CEST, Johannes Bauer wrote:

> On 22.08.2015 16:15, Christian Gollwitzer wrote:
>
>> Probably yes. You should take a look at the OP again and compare
>> the time stamps. It says that in between two consecutive calls of
>> the same program, the request was served once in a second, and once
>> with serious delays. Despite that the server is localhost. In
>> between both trials there are 20 seconds. I do not see, how git
>> bisect would help here.
>
> I do completely understand that in two consecutive runs one time the
> problem occurs and the other time it doesn't.
>
> It's highly unlikely that such a bug would ever have passed the
> bottle QA and if it did it would affect thousands of users (who
> would report this issue, since it's very severe). It is much more
> likely the bug is somewhere within the OP's program. By git bisect
> he can find out where he introduced the bug.

You have to explain something to me: how can I introduce a bug without
changing anything? Maybe by having wrong thoughts?


>> Note that this says nothing about the location of the bug, in can
>> still be either in the OPs code or in the framework.
>
> Yup. Note that he has now shifted from blaming bottle to blaming
> Firefox. Same thing with that claim. If somehow website delivery was
> delayed 6 seconds reproducibly, people would have noticed.

I never blamed bottle, I was asking if it could be a problem with
bottle.

And it is (now) clear that it has to do something with Firefox. Just
fetching the URL's does not give a problem. Chromium does not have a
problem. Only Firefox has a problem. Even in safemode. And with an
older version of Firefox there is (almost) no problem.


> I suspect that either the OPs program is at fault or the OP's setup
> (name resolution or some other weird stuff going on). But instead of
> tackling this problem systematically, like a Software Engineer would
> (Wireshark, debugger, profiler) he just blames other people's
> software. This, in my humble opinion, is annoying as fuck.

Do you know what I find annoying? That you need to keep bashing me,
instead of thinking: was I maybe wrong in bashing? Especially because
you are the only one that thinks you were right. Being the only one
who thinks something, does not necessarily make you wrong, but should
make you contemplate.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Johannes Bauer
On 22.08.2015 16:15, Christian Gollwitzer wrote:

> Probably yes. You should take a look at the OP again and compare the
> time stamps. It says that in between two consecutive calls of the same
> program, the request was served once in a second, and once with serious
> delays. Despite that the server is localhost. In between both trials
> there are 20 seconds. I do not see, how git bisect would help here.

I do completely understand that in two consecutive runs one time the
problem occurs and the other time it doesn't.

It's highly unlikely that such a bug would ever have passed the bottle
QA and if it did it would affect thousands of users (who would report
this issue, since it's very severe). It is much more likely the bug is
somewhere within the OP's program. By git bisect he can find out where
he introduced the bug.

> Note that this says nothing about the location of the bug, in can still
> be either in the OPs code or in the framework.

Yup. Note that he has now shifted from blaming bottle to blaming
Firefox. Same thing with that claim. If somehow website delivery was
delayed 6 seconds reproducibly, people would have noticed.

I suspect that either the OPs program is at fault or the OP's setup
(name resolution or some other weird stuff going on). But instead of
tackling this problem systematically, like a Software Engineer would
(Wireshark, debugger, profiler) he just blames other people's software.
This, in my humble opinion, is annoying as fuck.

Cheers,
Johannes

-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
 - Karl Kaos über Rüdiger Thomas in dsa 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-23 Thread Cecil Westerhof
On Sunday 23 Aug 2015 03:05 CEST, Chris Angelico wrote:

>> But in principal I have found the problem. (Not the reason.) The
>> problem is Firefox. (So it is not bottle and also not AngularJS.)
>> When using Chrome there is no problem. Not even when I do 15 times
>> a refresh. With Firefox there is this problem. Even when I restart
>> it.
>
> Huh, interesting. I can't help there, but I wish you the very best
> of luck in finding it.

It looks like it is a recent problem. I also installed it on an old
AcerAspire One. The fetch takes there five times as long, but fetching
through Firefox is a lot faster. Not as fast as Chromium, but the
difference is a lot less. But there Ice-wasel 38.0 is used instead of
Firefox 40.

Mozilla wants a life version. I am trying to install it on
PythonAnywhere.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Chris Angelico
On Sun, Aug 23, 2015 at 10:51 AM, Cecil Westerhof  wrote:
> How do I see if there is an open socket?

Depends on your OS. On Linux, I can poke around in /proc or with
commands like netstat and/or lsof. It may be easier to separate client
and server across two computers, which would force the socket to be a
"real" network connection, rather than being optimized away.

> But in principal I have found the problem. (Not the reason.) The
> problem is Firefox. (So it is not bottle and also not AngularJS.) When
> using Chrome there is no problem. Not even when I do 15 times a
> refresh. With Firefox there is this problem. Even when I restart it.

Huh, interesting. I can't help there, but I wish you the very best of
luck in finding it.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Cecil Westerhof
On Sunday 23 Aug 2015 01:13 CEST, Chris Angelico wrote:

> On Sun, Aug 23, 2015 at 7:06 AM, Cecil Westerhof  wrote:
>> I have included the output as attachment. It is clear that bottle
>> is not the problem: fetching all the data takes at most 0.017
>> seconds.
>>
>
> Something to consider: You could be running into some weird
> interaction of caches. Try blowing your OS and browser caches, and
> see what the timings are like then. Also, if you can recreate the
> six-second delay, I'd want to know what's happening during that time
> - is there an open socket between the browser and the server? Is
> anything pegging the CPU? Is the disk heavily active? Finding any
> sort of saturation would help to pin down the cause of the delay. Do
> you have any network mounts in your file system, and could they be
> delaying some stat() call somewhere? Six seconds is a lot, but I do
> recall running into problems occasionally when I had a
> NETBIOS/NETBEUI mount on one of my boxes (Linux couldn't safely
> cache stuff, and the remote system was misconfigured as regards
> caching, I think - the upshot was terrible performance in certain
> situations, all of it spent waiting on the network).

How do I see if there is an open socket?

But in principal I have found the problem. (Not the reason.) The
problem is Firefox. (So it is not bottle and also not AngularJS.) When
using Chrome there is no problem. Not even when I do 15 times a
refresh. With Firefox there is this problem. Even when I restart it.

So I have found the problem and it is certainly not a Python problem.
I should post it on the Firefox, but if there will be an use-full
reply … I have been reading it for a long time. And when someone
mentioned that Firefox used to much CPU or memory the replies where in
my opinion not very helpful.

It even happens with Firefox in safe-mode. Less often and not two
times, but max one time.

Well, first some sleep and then trying to get something useful from
the Firefox mailing-list. ;-)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Chris Angelico
On Sun, Aug 23, 2015 at 7:06 AM, Cecil Westerhof  wrote:
> I have included the output as attachment. It is clear that bottle is
> not the problem: fetching all the data takes at most 0.017 seconds.
>

Something to consider: You could be running into some weird
interaction of caches. Try blowing your OS and browser caches, and see
what the timings are like then. Also, if you can recreate the
six-second delay, I'd want to know what's happening during that time -
is there an open socket between the browser and the server? Is
anything pegging the CPU? Is the disk heavily active? Finding any sort
of saturation would help to pin down the cause of the delay. Do you
have any network mounts in your file system, and could they be
delaying some stat() call somewhere? Six seconds is a lot, but I do
recall running into problems occasionally when I had a NETBIOS/NETBEUI
mount on one of my boxes (Linux couldn't safely cache stuff, and the
remote system was misconfigured as regards caching, I think - the
upshot was terrible performance in certain situations, all of it spent
waiting on the network).

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Cecil Westerhof
On Saturday 22 Aug 2015 20:03 CEST, Cecil Westerhof wrote:

> On Saturday 22 Aug 2015 17:33 CEST, Michael Torrie wrote:
>
>> On 08/22/2015 05:37 AM, Cecil Westerhof wrote:
 I don't know. Is it bottle, or the browser, or something
 completely different that eats the extra time?
>>>
>>> I really do not know. I suspect bottle, but I am new to this, so I
>>> value the suspicion of someone who has more experience more. :-D
>>
>> These are requests performed from browser Javascript (ajax), right?
>> Could you write a shell script that fetches these urls in sequence
>> using curl or wget, simulating the web browser? This would let you
>> check times in a controlled way, without the variable of the
>> browser itself.
>
> I should have thought about that myself. :-(

I used Python instead of a shell script of-course. :-P


#!/usr/bin/env python3

import time

from urllib.request import urlopen


server = 'http://localhost:8080'
urls   = [
'/',
'/static/css/default.css',
'/static/JavaScript/angular.js',
'/static/appPublishedPhotos.js',
'/links/data',
'/versionPython',
'/versionSQLite',
]
for x in range(0, 10):
start_time = time.time()
for url in urls:
print(url)
urlopen(server + url).read()
end_time = time.time()
print('It took {0} seconds\n'.format(end_time - start_time), flush = True)
time.sleep(20)


It is not perfect code, no error checking and the last sleep is
superfluous, but for the current job good enough.

I have included the output as attachment. It is clear that bottle is
not the problem: fetching all the data takes at most 0.017 seconds.

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.012779951095581055 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.010144948959350586 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.010040283203125 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.013696908950805664 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.01705002784729004 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.009366750717163086 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.011032581329345703 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.015336990356445312 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.016999244689941406 seconds

/
/static/css/default.css
/static/JavaScript/angular.js
/static/appPublishedPhotos.js
/links/data
/versionPython
/versionSQLite
It took 0.010639429092407227 seconds


So my next bet is AngularJS.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Cecil Westerhof
On Saturday 22 Aug 2015 17:33 CEST, Michael Torrie wrote:

> On 08/22/2015 05:37 AM, Cecil Westerhof wrote:
>>> I don't know. Is it bottle, or the browser, or something
>>> completely different that eats the extra time?
>>
>> I really do not know. I suspect bottle, but I am new to this, so I
>> value the suspicion of someone who has more experience more. :-D
>
> These are requests performed from browser Javascript (ajax), right?
> Could you write a shell script that fetches these urls in sequence
> using curl or wget, simulating the web browser? This would let you
> check times in a controlled way, without the variable of the browser
> itself.

I should have thought about that myself. :-(

I was already thinking about writing debug statements in the routes.

By the way does anybody know what the time-stamp is: the moment the
requests is received, or the moment the request is finished?

I just tried it again. Two almost immediately and then a long one
again. What I find very peculiarly is that every-time there is a
delay, there are two delays of six seconds.


> While it's true this particular problem is possibly beyond the scope
> of this python list (and may not be python-related at all), it's too
> bad a couple of people have taken the time to reply to your queries
> to simply berate you.

It could be an AngularJS problem. ;-)

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Rustom Mody
On Saturday, August 22, 2015 at 9:03:52 PM UTC+5:30, Michael Torrie wrote:

> While it's true this particular problem is possibly beyond the scope of
> this python list (and may not be python-related at all), it's too bad a
> couple of people have taken the time to reply to your queries to simply
> berate you.

Yeah -- quite uncalled for.

As for beyond scope, I believe Peter Otten recommended bottle just a
few days ago. So I dont see whats improper about the question.
At some point of course someone may say: "Bottle written in python doesn't 
mean this is a python question."
If after that the questions continue and they are persistent and asinine and...
then berating may be ok. Dont see that here
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Michael Torrie
On 08/22/2015 05:37 AM, Cecil Westerhof wrote:
>> I don't know. Is it bottle, or the browser, or something completely 
>> different that eats the extra time?
> 
> I really do not know. I suspect bottle, but I am new to this, so I
> value the suspicion of someone who has more experience more. :-D

These are requests performed from browser Javascript (ajax), right?
Could you write a shell script that fetches these urls in sequence using
curl or wget, simulating the web browser?  This would let you check
times in a controlled way, without the variable of the browser itself.

While it's true this particular problem is possibly beyond the scope of
this python list (and may not be python-related at all), it's too bad a
couple of people have taken the time to reply to your queries to simply
berate you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Christian Gollwitzer

Am 22.08.15 um 15:51 schrieb Johannes Bauer:

On 22.08.2015 15:09, Cecil Westerhof wrote:


So let me get your story straight:


I wish you really meant that.


I really do, did I get it wrong at all? I really don't think that I did.


Probably yes. You should take a look at the OP again and compare the 
time stamps. It says that in between two consecutive calls of the same 
program, the request was served once in a second, and once with serious 
delays. Despite that the server is localhost. In between both trials 
there are 20 seconds. I do not see, how git bisect would help here.


Note that this says nothing about the location of the bug, in can still 
be either in the OPs code or in the framework.


Christian
--
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Johannes Bauer
On 22.08.2015 15:09, Cecil Westerhof wrote:

>> So let me get your story straight:
> 
> I wish you really meant that.

I really do, did I get it wrong at all? I really don't think that I did.

> Also: take a course in reading.

Maybe you, oh very wise Senior Software Engineer, should take a course
in Software Engineering. You wouldn't otherwise ask embarassingly stupid
questions over and over and over again. Really eats away at your
seniority if you ask me.

Cheers,
Johannes

-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
 - Karl Kaos über Rüdiger Thomas in dsa 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Cecil Westerhof
On Saturday 22 Aug 2015 14:09 CEST, Johannes Bauer wrote:

> On 22.08.2015 13:28, Cecil Westerhof wrote:
>
>> If you would have taken a little more time you would have seen that
>> there where 20 seconds between both logs. I am fast, but not that
>> fast. It is exactly the same code. I suppose it has to do something
>> with bottle. Something I use since yesterday. Is it that strange to
>> look if someone else has had the same problem and maybe a solution?
>
> So let me get your story straight:

I wish you really meant that. You just like to bash people. I am
afraid I need to ignore you.

Have a happy life. Do not forget to look in the mirror. Will be
painful in the short term, but very beneficial in the long term.

Also: take a course in reading.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Johannes Bauer
On 22.08.2015 13:28, Cecil Westerhof wrote:

> If you would have taken a little more time you would have seen that
> there where 20 seconds between both logs. I am fast, but not that
> fast. It is exactly the same code. I suppose it has to do something
> with bottle. Something I use since yesterday. Is it that strange to
> look if someone else has had the same problem and maybe a solution?

So let me get your story straight:

You're new to bottle and, apparently, web-programming in Python as well.
You're new to sqlite.
You've built some web application using both.
Yesterday it worked perfectly.
Today it doesn't.
Obviously, you suspect bottle is at fault.

Being the very wise Senior Software Engineer that you are, do you really
think that mature software, programmed by people who actually know what
they're doing is at fault? Or do you rather think it maybe could be the
piece-of-junk demo application written by someone who has proven his
utter incompetence comprehensively time and time again?

Since you're the very wise Senior Software Engineer here, why don't you
use an approach that every schoolkid learns in a programming class?
Namely, circle the error, reproduce it reliably. Change your machine,
network setup and change between your software versions. Create a
minimal example that demonstrate the issue. Then, should you find one,
blame bottle. Not sooner, very wise Senior Software Engineer, not sooner.

Cheers,
Johannes

-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
 - Karl Kaos über Rüdiger Thomas in dsa 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Cecil Westerhof
On Saturday 22 Aug 2015 09:49 CEST, Peter Otten wrote:

> Cecil Westerhof wrote:
>
>> I created a simple application with bottle:
>> https://github.com/CecilWesterhof/PublishedPhotos
>>
>> But sometimes it needs a lot of time. For example: 127.0.0.1 - -
>> [21/Aug/2015 23:16:40] "GET / HTTP/1.1" 304 0 127.0.0.1 - -
>> [21/Aug/2015 23:16:40] "GET /static/css/default.css HTTP/1.1" 304 0
>> 127.0.0.1 - - [21/Aug/2015 23:16:46] "GET
>> /static/JavaScript/angular.js HTTP/1.1" 304 0 127.0.0.1 - -
>> [21/Aug/2015 23:16:46] "GET /static/appPublishedPhotos.js HTTP/1.1"
>> 304 0 127.0.0.1 - - [21/Aug/2015 23:16:46] "GET /links/data
>> HTTP/1.1" 200 2884 127.0.0.1 - - [21/Aug/2015 23:16:52] "GET
>> /versionPython HTTP/1.1" 200 5 127.0.0.1 - - [21/Aug/2015 23:16:52]
>> "GET /versionSQLite HTTP/1.1" 200 5
>>
>> Between default.css and angular.js there are six seconds. And
>> between /links/data and /versionPytjon is again six seconds. What
>> is happening here?
>
> I don't know. Is it bottle, or the browser, or something completely 
> different that eats the extra time?

I really do not know. I suspect bottle, but I am new to this, so I
value the suspicion of someone who has more experience more. :-D


>> Just before everything was done in a second: 127.0.0.1 - -
>> [21/Aug/2015 23:16:22] "GET / HTTP/1.1" 200 956 127.0.0.1 - -
>> [21/Aug/2015 23:16:22] "GET /static/css/default.css HTTP/1.1" 304 0
>> 127.0.0.1 - - [21/Aug/2015 23:16:22] "GET
>> /static/appPublishedPhotos.js HTTP/1.1" 304 0 127.0.0.1 - -
>> [21/Aug/2015 23:16:22] "GET /static/JavaScript/angular.js HTTP/1.1"
>> 304 0 127.0.0.1 - - [21/Aug/2015 23:16:23] "GET /versionPython
>> HTTP/1.1" 200 5 127.0.0.1 - - [21/Aug/2015 23:16:23] "GET
>> /links/data HTTP/1.1" 200 2884 127.0.0.1 - - [21/Aug/2015 23:16:23]
>> "GET /versionSQLite HTTP/1.1" 200 5
>>

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Cecil Westerhof
On Friday 21 Aug 2015 23:55 CEST, gst wrote:

> What if you try with all the SQLite code commented ?

I do not think that is the problem. First of all I do not think
receiving 25 records takes 6 seconds.

Secondly the first part is:
127.0.0.1 - - [21/Aug/2015 23:16:40] "GET / HTTP/1.1" 304 0
127.0.0.1 - - [21/Aug/2015 23:16:40] "GET /static/css/default.css HTTP/1.1" 304 0
127.0.0.1 - - [21/Aug/2015 23:16:46] "GET /static/JavaScript/angular.js 
HTTP/1.1" 304 0
127.0.0.1 - - [21/Aug/2015 23:16:46] "GET /static/appPublishedPhotos.js 
HTTP/1.1" 304 0

There is no SQLite code at all there. Only Not Modified replies.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Cecil Westerhof
On Saturday 22 Aug 2015 11:41 CEST, Johannes Bauer wrote:

> On 21.08.2015 23:22, Cecil Westerhof wrote:
>
>> Just before everything was done in a second:
>
> Since you're on GitHub, why don't you git bisect and find out where
> you screwed up instead of trying to get people to remotely debug and
> profile your broken code?

Are you beaten up by your wife that you need to be this harsh?

If you would have taken a little more time you would have seen that
there where 20 seconds between both logs. I am fast, but not that
fast. It is exactly the same code. I suppose it has to do something
with bottle. Something I use since yesterday. Is it that strange to
look if someone else has had the same problem and maybe a solution?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Johannes Bauer
On 21.08.2015 23:22, Cecil Westerhof wrote:

> Just before everything was done in a second:

Since you're on GitHub, why don't you git bisect and find out where you
screwed up instead of trying to get people to remotely debug and profile
your broken code?

Cheers,
Johannes

-- 
>> Wo hattest Du das Beben nochmal GENAU vorhergesagt?
> Zumindest nicht öffentlich!
Ah, der neueste und bis heute genialste Streich unsere großen
Kosmologen: Die Geheim-Vorhersage.
 - Karl Kaos über Rüdiger Thomas in dsa 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Sometimes bottle takes a lot of time

2015-08-22 Thread Peter Otten
Cecil Westerhof wrote:

> I created a simple application with bottle:
> https://github.com/CecilWesterhof/PublishedPhotos
> 
> But sometimes it needs a lot of time. For example:
> 127.0.0.1 - - [21/Aug/2015 23:16:40] "GET / HTTP/1.1" 304 0
> 127.0.0.1 - - [21/Aug/2015 23:16:40] "GET /static/css/default.css
> HTTP/1.1" 304 0 127.0.0.1 - - [21/Aug/2015 23:16:46] "GET
> /static/JavaScript/angular.js HTTP/1.1" 304 0 127.0.0.1 - - [21/Aug/2015
> 23:16:46] "GET /static/appPublishedPhotos.js HTTP/1.1" 304 0 127.0.0.1 - -
> [21/Aug/2015 23:16:46] "GET /links/data HTTP/1.1" 200 2884 127.0.0.1 - -
> [21/Aug/2015 23:16:52] "GET /versionPython HTTP/1.1" 200 5 127.0.0.1 - -
> [21/Aug/2015 23:16:52] "GET /versionSQLite HTTP/1.1" 200 5
> 
> Between default.css and angular.js there are six seconds. And between
> /links/data and /versionPytjon is again six seconds. What is happening
> here?

I don't know. Is it bottle, or the browser, or something completely 
different that eats the extra time?

> Just before everything was done in a second:
> 127.0.0.1 - - [21/Aug/2015 23:16:22] "GET / HTTP/1.1" 200 956
> 127.0.0.1 - - [21/Aug/2015 23:16:22] "GET /static/css/default.css
> HTTP/1.1" 304 0 127.0.0.1 - - [21/Aug/2015 23:16:22] "GET
> /static/appPublishedPhotos.js HTTP/1.1" 304 0 127.0.0.1 - - [21/Aug/2015
> 23:16:22] "GET /static/JavaScript/angular.js HTTP/1.1" 304 0 127.0.0.1 - -
> [21/Aug/2015 23:16:23] "GET /versionPython HTTP/1.1" 200 5 127.0.0.1 - -
> [21/Aug/2015 23:16:23] "GET /links/data HTTP/1.1" 200 2884 127.0.0.1 - -
> [21/Aug/2015 23:16:23] "GET /versionSQLite HTTP/1.1" 200 5
> 


-- 
https://mail.python.org/mailman/listinfo/python-list